﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.ServiceModel;
using SharepointWS; 
namespace SharepointWSDeploy
{
    public partial class SharepointWS : ServiceBase
    {

        ServiceHost _spWS = null;

        public SharepointWS()
        {
            InitializeComponent();
        }

        protected override void OnStart(string[] args)
        {
            Trace.WriteLine("Inciando MGI spWS...");
            _spWS = new ServiceHost(typeof(SharepointProxy));
            _spWS.Open();
        }

        protected override void OnStop()
        {
            Trace.WriteLine("Cerrando MGI...");
            if (_spWS != null)
            {
                _spWS.Close();
                _spWS = null;
            }
        }
    }
}
